package _11Collection接口;

import java.util.ArrayList;
import java.util.Collection;

public class DemoCollertion {

    public static void main(String[] args) {
        Collection<String> collection = new ArrayList<>();


        //集合添加元素 add
        collection.add("java");
        collection.add("python");
        collection.add("c++");

        //集合中删除某个元素
//        boolean remove = collection.remove("python");
//        System.out.println(remove);

        //清空集合元素
//        collection.clear();
//        System.out.println(collection);

        //判断集合中是否包含某个元素
//        boolean contains = collection.contains("java");
//        System.out.println(contains);


        //判断集合是否为空
        boolean empty = collection.isEmpty();
        System.out.println(empty);

        //集合的长度
        System.out.println(collection.size());

    }
}
